/*
 Navicat Premium Data Transfer

 Source Server         : TOP内网-195
 Source Server Type    : MySQL
 Source Server Version : 80035
 Source Host           : 192.168.50.195:3306
 Source Schema         : prefix_projecttemplate_api_dev

 Target Server Type    : MySQL
 Target Server Version : 80035
 File Encoding         : 65001

 Date: 22/02/2024 11:33:29
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for log_login_log
-- ----------------------------
DROP TABLE IF EXISTS `log_login_log`;
CREATE TABLE `log_login_log` (
  `userId` bigint NOT NULL COMMENT '用户ID',
  `userType` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '用户类型',
  `accessId` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '访问ID',
  `accessKey` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '访问Key',
  `source` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '来源',
  `requestIp` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '请求IP',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_accessId` (`accessId`) USING BTREE,
  KEY `normal_userId` (`userId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='登陆日志';

-- ----------------------------
-- Records of log_login_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for log_operator_log
-- ----------------------------
DROP TABLE IF EXISTS `log_operator_log`;
CREATE TABLE `log_operator_log` (
  `accessId` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '访问ID',
  `name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '应用名称',
  `method` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '方法',
  `uri` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT 'URI',
  `queryString` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '请求参数',
  `requestHeader` json NOT NULL COMMENT '请求头',
  `requestContent` mediumtext COLLATE utf8mb4_bin NOT NULL COMMENT '请求体',
  `responseContent` mediumtext COLLATE utf8mb4_bin NOT NULL COMMENT '响应日志内容',
  `requestId` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '请求Id',
  `requestIp` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '请求IP地址',
  `localIp` varchar(15) COLLATE utf8mb4_bin NOT NULL COMMENT '本机IP地址',
  `serverTime` datetime NOT NULL COMMENT '服务器时间',
  `workerId` int NOT NULL COMMENT '所属工作机器索引',
  `dataCenterId` int NOT NULL COMMENT '所在数据中心索引',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_requestId` (`requestId`) USING BTREE,
  KEY `normal_accessId` (`accessId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='操作日志';

-- ----------------------------
-- Records of log_operator_log
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_auth
-- ----------------------------
DROP TABLE IF EXISTS `sys_auth`;
CREATE TABLE `sys_auth` (
  `name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '接口名称',
  `parentId` bigint NOT NULL COMMENT '父ID',
  `action` varchar(100) COLLATE utf8mb4_bin NOT NULL COMMENT '操作码',
  `uri` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '接口地址',
  `method` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '请求方法',
  `value` int NOT NULL COMMENT '授权值',
  `sort` int NOT NULL COMMENT '排序值',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_action` (`action`) USING BTREE,
  KEY `normal_parentId` (`parentId`) USING BTREE,
  KEY `normal_value` (`value`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='授权';

-- ----------------------------
-- Records of sys_auth
-- ----------------------------
BEGIN;
INSERT INTO `sys_auth` VALUES ('主要功能', 0, 'main', '/', 'ALL', 1, 3, '2024-02-22 10:56:21', '2024-02-21 22:32:07', 1);
INSERT INTO `sys_auth` VALUES ('系统管理', 0, 'system', '/', 'ALL', 1, 2, '2024-02-22 11:00:28', '2024-02-21 22:32:16', 2);
INSERT INTO `sys_auth` VALUES ('用户管理', 1, '949bcb2a2045c3e6f253e314935a1780', '/v1/user/page', 'ALL', 0, 999, '2024-02-22 11:00:28', '2024-02-21 22:31:59', 1210179293141794816);
INSERT INTO `sys_auth` VALUES ('角色管理', 2, 'c474797fe9b8b8f7c722ad547cf2dffb', '/v1/role/page', 'ALL', 0, 999, '2024-02-22 11:00:28', '2024-02-21 22:32:01', 1210179293141794817);
COMMIT;

-- ----------------------------
-- Table structure for sys_configure
-- ----------------------------
DROP TABLE IF EXISTS `sys_configure`;
CREATE TABLE `sys_configure` (
  `groupId` int NOT NULL COMMENT '组ID',
  `code` varchar(50) COLLATE utf8mb4_bin NOT NULL COMMENT '编号',
  `value` text COLLATE utf8mb4_bin NOT NULL COMMENT '值',
  `type` enum('String','JSONObject','JSONArray') COLLATE utf8mb4_bin NOT NULL COMMENT '值类型(字符:String,JSON:JSONObject,JSON数组:JSONArray)',
  `remark` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '备注',
  `sorted` int NOT NULL COMMENT '排序',
  `disable` enum('true','false') COLLATE utf8mb4_bin NOT NULL COMMENT '是否禁用',
  `id` bigint NOT NULL COMMENT '主键',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_code` (`code`) USING BTREE,
  KEY `normal_groupId` (`groupId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='配置';

-- ----------------------------
-- Records of sys_configure
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `name` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '名称',
  `code` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '编码',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_code` (`code`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色';

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('超级管理员', 'admin', '2024-01-17 14:21:09', '2024-02-21 22:31:12', 1);
COMMIT;

-- ----------------------------
-- Table structure for sys_role_auth_relation
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_auth_relation`;
CREATE TABLE `sys_role_auth_relation` (
  `roleId` bigint NOT NULL COMMENT '角色ID',
  `authId` bigint NOT NULL COMMENT '授权ID',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_roleId_authId` (`roleId`,`authId`) USING BTREE,
  KEY `normal_roleId` (`roleId`) USING BTREE,
  KEY `normal_authId` (`authId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='角色授权关系';

-- ----------------------------
-- Records of sys_role_auth_relation
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_auth_relation` VALUES (1, 1210179293141794816, '2024-02-22 11:28:38', '2024-02-22 11:28:38', 1210186385495949312);
INSERT INTO `sys_role_auth_relation` VALUES (1, 1210179293141794817, '2024-02-22 11:28:38', '2024-02-22 11:28:38', 1210186385495949313);
COMMIT;

-- ----------------------------
-- Table structure for sys_secret_key
-- ----------------------------
DROP TABLE IF EXISTS `sys_secret_key`;
CREATE TABLE `sys_secret_key` (
  `accessId` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '访问ID',
  `accessKey` varchar(64) COLLATE utf8mb4_bin NOT NULL COMMENT '密钥',
  `type` int NOT NULL COMMENT '类型',
  `invalidTime` datetime NOT NULL COMMENT '失效时间',
  `remark` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '备注',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_accessId` (`accessId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='密钥';

-- ----------------------------
-- Records of sys_secret_key
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `password` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '密码MD5',
  `name` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '姓名',
  `disable` enum('true','false') COLLATE utf8mb4_bin NOT NULL COMMENT '是否禁用',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `id` bigint NOT NULL COMMENT '主键',
  `userName` varchar(32) COLLATE utf8mb4_bin NOT NULL COMMENT '用户名',
  `deleted` bigint NOT NULL COMMENT '删除标记(0:未删除,非零:删除)',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_userName_deleted` (`userName`,`deleted`) USING BTREE,
  KEY `normal_userName` (`userName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户';

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('e10adc3949ba59abbe56e057f20f883e', 'admin', 'false', '2024-02-18 15:07:35', '2024-02-22 11:29:13', 1, 'admin', 0);
COMMIT;

-- ----------------------------
-- Table structure for sys_user_role_relation
-- ----------------------------
DROP TABLE IF EXISTS `sys_user_role_relation`;
CREATE TABLE `sys_user_role_relation` (
  `userId` bigint NOT NULL COMMENT '用户ID',
  `roleId` bigint NOT NULL COMMENT '角色ID',
  `created_date` datetime NOT NULL COMMENT '创建时间',
  `modified_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `id` bigint NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_userId_roleId` (`userId`,`roleId`) USING BTREE,
  KEY `normal_userId` (`userId`) USING BTREE,
  KEY `normal_roleId` (`roleId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户角色关系';

-- ----------------------------
-- Records of sys_user_role_relation
-- ----------------------------
BEGIN;
INSERT INTO `sys_user_role_relation` VALUES (1, 1, '2024-02-22 11:28:54', '2024-02-22 11:28:54', 1210186452541898752);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
